home *** CD-ROM | disk | FTP | other *** search
- /* (C) Copyright 1991 Dave Fritsche (wb8zxu), All Rights Reserved.
- *
- * Redistribution and use in source and binary forms are permitted for
- * non-commercial use, provided that the above copyright notice and this
- * paragraph are duplicated in all such forms. THIS SOFTWARE IS PROVIDED
- * ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
- * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE.
- */
- /*bdoc
- * Function "CHKTXT"
- *
- * Written: Dave Fritsche
- * Date: July, 1987
- *
- * A function to return the length of a string after truncating all
- * white space from the end.
- * Syntax:
- * length = chktxt(string)
- * Where:
- * string = The char string under consideration
- * length = Integer return of modified string length
- edoc*/
-
- #include <stdio.h>
- #include <ctype.h>
-
- int chktxt(text)
- char text[];
- {
- int n;
-
- n = strlen(text) - 1;
-
- while ( (n >= 0) && (isspace(text[n])) )
- {
- text[n] = text[n+1];
- n -= 1;
- }
-
- n = strlen(text);
-
- return(n);
- }
-